package com.zzp.zjs_bos.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zzp.zjs_bos.dao.IRoleDao;
import com.zzp.zjs_bos.domain.Function;
import com.zzp.zjs_bos.domain.Role;
import com.zzp.zjs_bos.service.IRoleService;
import com.zzp.zjs_bos.utils.PageBean;


@Service
@Transactional
public class RoleServiceImpl implements IRoleService {
	
	@Resource
	IRoleDao roleDao;
	
	
	public void save(Role model, String functionIds) {
		roleDao.save(model);
		String[] ids = functionIds.split(",");
		for (String id : ids) {
			Function function = new Function(id);
			model.getFunctions().add(function);
		}
	}

	public List<Role> findAll() {
		
		return roleDao.findAll();
	}



}
